<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Global Body Planner: include/global_body_planner/rrt.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Global Body Planner
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_94ddb28d1a8f6d812dff56d903a1ce15.html">global_body_planner</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">rrt.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef RRT_H</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define RRT_H</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;global_body_planner/planner_class.h&quot;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;chrono&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#define TRAPPED 0</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#define ADVANCED 1</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#define REACHED 2</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="keyword">using namespace </span><a class="code" href="namespaceplanning__utils.html">planning_utils</a>;</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="classRRTClass.html">   18</a></span>&#160;<span class="keyword">class </span><a class="code" href="classRRTClass.html">RRTClass</a></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;{</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;  <span class="keyword">public</span>:</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    <a class="code" href="classRRTClass.html">RRTClass</a>();</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    ~<a class="code" href="classRRTClass.html">RRTClass</a>();</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">int</span> extend(<a class="code" href="classPlannerClass.html">PlannerClass</a> &amp;T, State s, <a class="code" href="classFastTerrainMap.html">FastTerrainMap</a>&amp; terrain, <span class="keywordtype">int</span> direction);</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    std::vector&lt;int&gt; pathFromStart(<a class="code" href="classPlannerClass.html">PlannerClass</a> &amp;T, <span class="keywordtype">int</span> idx);</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    </div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <span class="keywordtype">void</span> printPath(<a class="code" href="classPlannerClass.html">PlannerClass</a> &amp;T, std::vector&lt;int&gt; path);</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    </div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <span class="keywordtype">void</span> buildRRT(<a class="code" href="classFastTerrainMap.html">FastTerrainMap</a>&amp; terrain, State s_start, State s_goal, std::vector&lt;State&gt; &amp;state_sequence, std::vector&lt;Action&gt; &amp;action_sequence);</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    </div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keywordtype">void</span> getStatistics(<span class="keywordtype">double</span> &amp;plan_time, <span class="keywordtype">int</span> &amp;success_var, <span class="keywordtype">int</span> &amp;vertices_generated, <span class="keywordtype">double</span> &amp;time_to_first_solve, std::vector&lt;double&gt; &amp;cost_vector, </div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;      std::vector&lt;double&gt; &amp;cost_vector_times, <span class="keywordtype">double</span>&amp; path_duration);</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <span class="keywordtype">bool</span> newConfig(State s, State s_near, State &amp;s_new, Action &amp;a_new, <a class="code" href="classFastTerrainMap.html">FastTerrainMap</a>&amp; terrain, <span class="keywordtype">int</span> direction);</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    std::vector&lt;State&gt; getStateSequence(<a class="code" href="classPlannerClass.html">PlannerClass</a> &amp;T, std::vector&lt;int&gt; path);</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    </div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    std::vector&lt;Action&gt; getActionSequence(<a class="code" href="classPlannerClass.html">PlannerClass</a> &amp;T, std::vector&lt;int&gt; path);</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;  <span class="keyword">protected</span>:</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="classRRTClass.html#a3bea12d5a94669ee0713d8447c575f4b">  109</a></span>&#160;    <span class="keyword">const</span> <span class="keywordtype">double</span> prob_goal_thresh = 0.05;</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div><div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="classRRTClass.html#abd63c1f08cf738a4966010968e615e0a">  112</a></span>&#160;    <span class="keywordtype">bool</span> goal_found = <span class="keyword">false</span>;</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div><div class="line"><a name="l00115"></a><span class="lineno"><a class="line" href="classRRTClass.html#aaaf8027527034bc8fc424ff91f59acb6">  115</a></span>&#160;    std::chrono::duration&lt;double&gt; <a class="code" href="classRRTClass.html#aaaf8027527034bc8fc424ff91f59acb6">elapsed_total</a>;</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <span class="comment">// Total time elapsed until the first solve</span></div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    std::chrono::duration&lt;double&gt; elapsed_to_first;</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;</div><div class="line"><a name="l00121"></a><span class="lineno"><a class="line" href="classRRTClass.html#a7cddb22b09f2be69b1d93eb337963d03">  121</a></span>&#160;    <span class="keywordtype">int</span> success_ = 0;</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div><div class="line"><a name="l00124"></a><span class="lineno"><a class="line" href="classRRTClass.html#af6e0461555d33efc0bce6dbeb4f1e741">  124</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classRRTClass.html#af6e0461555d33efc0bce6dbeb4f1e741">num_vertices</a>;</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;</div><div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="classRRTClass.html#af0be1d3d077c4ea197b62a49a7c78277">  127</a></span>&#160;    <span class="keywordtype">double</span> <a class="code" href="classRRTClass.html#af0be1d3d077c4ea197b62a49a7c78277">path_quality_</a>;</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;</div><div class="line"><a name="l00130"></a><span class="lineno"><a class="line" href="classRRTClass.html#afcad861656af64f757753dd41f2fa5a9">  130</a></span>&#160;    std::vector&lt;double&gt; <a class="code" href="classRRTClass.html#afcad861656af64f757753dd41f2fa5a9">cost_vector_</a>;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;</div><div class="line"><a name="l00133"></a><span class="lineno"><a class="line" href="classRRTClass.html#acbbbd085d2648f8f39c664776163bf18">  133</a></span>&#160;    std::vector&lt;double&gt; <a class="code" href="classRRTClass.html#acbbbd085d2648f8f39c664776163bf18">cost_vector_times_</a>;</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;</div><div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="classRRTClass.html#a3c8e83183a9d3383571eccbdde77d842">  136</a></span>&#160;    <span class="keywordtype">double</span> <a class="code" href="classRRTClass.html#a3c8e83183a9d3383571eccbdde77d842">path_duration_</a>;</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;        </div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;        </div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;};</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="namespaceplanning__utils_html"><div class="ttname"><a href="namespaceplanning__utils.html">planning_utils</a></div><div class="ttdef"><b>Definition:</b> planning_utils.h:18</div></div>
<div class="ttc" id="classPlannerClass_html"><div class="ttname"><a href="classPlannerClass.html">PlannerClass</a></div><div class="ttdoc">A directed graph class with supplemental methods to aid in sample-based planning. ...</div><div class="ttdef"><b>Definition:</b> planner_class.h:13</div></div>
<div class="ttc" id="classRRTClass_html_aaaf8027527034bc8fc424ff91f59acb6"><div class="ttname"><a href="classRRTClass.html#aaaf8027527034bc8fc424ff91f59acb6">RRTClass::elapsed_total</a></div><div class="ttdeci">std::chrono::duration&lt; double &gt; elapsed_total</div><div class="ttdoc">Total time elapsed in this planner call. </div><div class="ttdef"><b>Definition:</b> rrt.h:115</div></div>
<div class="ttc" id="classRRTClass_html_afcad861656af64f757753dd41f2fa5a9"><div class="ttname"><a href="classRRTClass.html#afcad861656af64f757753dd41f2fa5a9">RRTClass::cost_vector_</a></div><div class="ttdeci">std::vector&lt; double &gt; cost_vector_</div><div class="ttdoc">Vector of costs each time a better one is found. </div><div class="ttdef"><b>Definition:</b> rrt.h:130</div></div>
<div class="ttc" id="classFastTerrainMap_html"><div class="ttname"><a href="classFastTerrainMap.html">FastTerrainMap</a></div><div class="ttdoc">A terrain map class built for fast and efficient sampling. </div><div class="ttdef"><b>Definition:</b> fast_terrain_map.h:10</div></div>
<div class="ttc" id="classRRTClass_html_acbbbd085d2648f8f39c664776163bf18"><div class="ttname"><a href="classRRTClass.html#acbbbd085d2648f8f39c664776163bf18">RRTClass::cost_vector_times_</a></div><div class="ttdeci">std::vector&lt; double &gt; cost_vector_times_</div><div class="ttdoc">Vector of times at which each better cost is found. </div><div class="ttdef"><b>Definition:</b> rrt.h:133</div></div>
<div class="ttc" id="classRRTClass_html"><div class="ttname"><a href="classRRTClass.html">RRTClass</a></div><div class="ttdoc">A class that implements RRT sampling-based planning. </div><div class="ttdef"><b>Definition:</b> rrt.h:18</div></div>
<div class="ttc" id="classRRTClass_html_a3c8e83183a9d3383571eccbdde77d842"><div class="ttname"><a href="classRRTClass.html#a3c8e83183a9d3383571eccbdde77d842">RRTClass::path_duration_</a></div><div class="ttdeci">double path_duration_</div><div class="ttdoc">The duration of the path in seconds. </div><div class="ttdef"><b>Definition:</b> rrt.h:136</div></div>
<div class="ttc" id="classRRTClass_html_af6e0461555d33efc0bce6dbeb4f1e741"><div class="ttname"><a href="classRRTClass.html#af6e0461555d33efc0bce6dbeb4f1e741">RRTClass::num_vertices</a></div><div class="ttdeci">int num_vertices</div><div class="ttdoc">Number of vertices in the tree. </div><div class="ttdef"><b>Definition:</b> rrt.h:124</div></div>
<div class="ttc" id="classRRTClass_html_af0be1d3d077c4ea197b62a49a7c78277"><div class="ttname"><a href="classRRTClass.html#af0be1d3d077c4ea197b62a49a7c78277">RRTClass::path_quality_</a></div><div class="ttdeci">double path_quality_</div><div class="ttdoc">Path quality in meters. </div><div class="ttdef"><b>Definition:</b> rrt.h:127</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
